package com.cskaoyan.market.admin.service.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.cskaoyan.market.admin.service.AdminRegionService;
import com.cskaoyan.market.db.domain.MarketRegion;
import com.cskaoyan.market.db.domain.MarketRegionExample;
import com.cskaoyan.market.db.mapper.MarketRegionMapper;
import com.cskaoyan.market.util.MyBatisUtil;

/**
 * @author BlackFlame33
 * @date 2023/03/20
 **/
public class AdminRegionServiceImpl implements AdminRegionService {
    @Override
    public List<MarketRegion> getRegionList() {
        SqlSession session = MyBatisUtil.getSession();
        MarketRegionMapper mapper = session.getMapper(MarketRegionMapper.class);
        List<MarketRegion> marketRegions = mapper.selectByExample(new MarketRegionExample());
        session.commit();
        session.close();
        return marketRegions;
    }
}